package practice.tree.four;

/**
 * @Description:
 * @Author Ammar
 * @Create 2023/8/21 20:34
 */
public class RedBlackNode extends TreeNode {
    public static final boolean BLACK = true;
    public static final boolean RED = false;

    public boolean color = RED;
    public RedBlackNode(Integer val, TreeNode parent) {
        super(val, parent);
    }

    @Override
    public String toString() {
        String parentStr = "null";
        if (parent != null) {
            parentStr = parent.val.toString();
        }
        return val + "_p(" + parentStr + ")_c(" + (color == RED ? "R" : "B") + ")";
    }
}
